<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
	<title>铁水联运信息核查系统--注册</title>
    <link rel="shortcut icon" href="${mainDomain}/statics/images/favicon.ico">
    <link rel="stylesheet" href="${mainDomain}/statics/css/front/amazeui.min.css"/>
    <link rel="stylesheet" href="${mainDomain}/statics/css/front/goodsstyle.css">
    <link rel="stylesheet" href="${mainDomain}/statics/css/front/custom.css">
    <script type="text/javascript">
        var mainDomain = "${mainDomain}";
		var miscDomain = '${mainDomain}';
    </script>
    <style>
    .header {
      text-align: center;
    }
    .header h1 {
      font-size: 200%;
      color: #333;
      margin-top: 30px;
    }
    .header p {
      font-size: 14px;
    }
    .item {
    	margin: 30px 0; 
    }
    .form {
    	text-align: center;
    }
    </style>
</head>
<body style="background:url(${mainDomain}/statics/images/ts-bg.jpg) no-repeat center top">
<!-- 头部导航 begin -->
<div id="logo"></div>
<!-- 头部导航 end -->
<div class="header" style="min-width:1349px;">
  <div class="am-g">
    
  </div>
  <div class="header">
  <div class="am-g" style="min-width: 1000px;">
    <div class="am-u-sm-5 logo" style="padding:0px;">    		
      		<!--<a href="/index"><img src="${mainDomain}/statics/images/x_logo.png"/></a>-->
      	</div>	
  </div>

</div>

<div  class="am-container"style="">
  <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered" style="width:720px;margin:auto;">
   <h1 style="text-align: center; color:#00688B; font-family: '微软简中国'; font-size:24px; margin-top: 10px;">欢迎注册</h1>
   <div style="margin:10px 0;">
     <img src="${mainDomain}/statics/images/goods/rg2.png">
   </div>
      <form id="my-form" class="am-form" action="javascript:;" method="post" data-am-validator>
           <input type="hidden" id="yhid" name="yhid" value="${userid}">
        	<table style="margin:auto;border-collapse:separate;border-spacing:15px;">
        	 <tr id="trqyqc">
        	    <td style="color:#00688B;text-align:right;">企业全称：</td>
        	    <td>
                    <input type="text" id="qyqc" name="qyqc"  maxlength="30" placeholder="请输入企业全称"  style="width:200px;border-radius:10px;height:35px;font-size:14px;">
                </td>
        	    <td><div id="qyqc_tips" style="color:red;font-size:14px;">＊ </div></td>
        	 </tr>
        	 <tr id="trqyjc">
        	    <td style="color:#00688B;text-align:right;">企业简称：</td>
        	    <td><input type="text"  name="qyjc" maxlength="15" style="width:200px;border-radius:10px;height:35px;font-size:14px;" placeholder="请输入企业简称"></td>
        	    <td></td>
        	 </tr>
        	 <tr id="trlxr">
        	    <td id="tdlxr" style="color:#00688B;text-align:right;">企业联系人：</td>
        	    <td><input type="text"  id="lxrxm" name="lxrxm" maxlength="60" style="width:200px;border-radius:10px;height:35px;font-size:14px;" placeholder="请输入企业联系人"   ></td>
        	    <td><div id="lxrxm_tips" style="color:red;font-size:14px;">＊ </div></td>
        	 </tr>
        	 <tr id="trdh">
        	    <td style="color:#00688B;text-align:right;">联系人座机：</td>
        	    <td><input type="text" maxlength="15" name="lxrzj" style="width:200px;border-radius:10px;height:35px;font-size:14px;" placeholder="请输入联系人座机" ></td>
        	    <td></td>
        	 </tr>
        	 <tr id="trsj">
        	    <td id="tdsj" style="color:#00688B;text-align:right;">联系人手机：</td>
        	    <td><input type="text" maxlength="11" id="lxrsj" name="lxrsj" style="width:200px;border-radius:10px;height:35px;font-size:14px;"  placeholder="请输入联系人手机"></td>
        	    <td><div id="lxrsj_tips" style="color:red;font-size:14px;">＊ </div></td>
        	 </tr>
        	 <tr id="trem">
        	    <td id="tdem" style="color:#00688B;text-align:right;">联系人邮箱：</td>
        	    <td><input type="email" maxlength="50" name="lxremail" id="lxremail" style="width:200px;border-radius:10px;height:35px;font-size:14px;" placeholder="请输入联系人邮箱"></td>
        	    <td><div id="lxremail_tips" style="color:red;font-size:14px;">＊ </div></td>
        	 </tr>
        	 <!--<tr id="trqq">
        	    <td style="color:#00688B;text-align:right;">客服QQ：</td>
        	    <td><input type="text" maxlength="20" name="kfqq" id="kfqq" style="width:200px;border-radius:10px;height:35px;font-size:14px;" placeholder="请输入客服QQ"></td>
        	    <td><div id="kfqq_tips" style="color:red;font-size:14px;">＊ </div></td>
        	 </tr>-->
        	 <tr >
			         <td colspan="3" style="text-align:center;"><button type="submit" id="saveButton" class="am-btn am-btn-primary am-btn-xs" style="width:200px;height30px;font-size:16px;">确认提交&nbsp;|&nbsp;下一步</button></td>
			         
			     </tr>
            </table>
        </form>
	<hr/>		
    </div>    
</div>
	
    <br>
    <footer data-am-widget="footer" class="am-footer am-footer-default" data-am-footer="{  }" style="min-width: 1349px;">
        <!--<div class="am-footer-switch" style="font-weight:normal;">
            <span class="am-footer-ysp" data-rel="mobile"
                  data-am-modal="{target: '#am-switch-mode'}">
                  武汉航运交易所
            </span>
              <span class="am-footer-divider"> | </span>
              <a id="godesktop" data-rel="desktop" class="am-footer-desktop" href="javascript:">
                  法律申明
              </a>
              <span class="am-footer-divider"> | </span>
              <span class=""> 鄂ICP备16003518 </span>
        </div>
        <div class="am-footer-miscs ">
            <p>版权所有：武汉航运交易所</p>
            <p>地址：武汉市江岸区金桥大道117号市民之家3楼F区</p>
            <p>电话：027-65771553</p>
        </div>-->
  </footer>
    <script type="text/javascript" src="${mainDomain}/statics/js/front/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/amazeui.min.js"></script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/formvalidation.js"></script>
	<script type="text/javascript" src="${mainDomain}/statics/js/front/registetwo.js"></script>
	<script>
	$('#my-form').validator(
    {
        validate: function (validity) {
        	if ($(validity.field).is('#qyqc')) {
        		if($.trim($("#qyqc").val()).length>30)
            	{
            		validity.valid = false;
            		$('#qyqc_tips').html("企业全称最多填30位");
            	}
            	else if($.trim($("#qyqc").val())=="")
            	{
            		validity.valid = false;
            		$('#qyqc_tips').html("*必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#qyqc_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#qyjc')) {
        		if($.trim($("#qyjc").val()).length>15)
            	{
            		validity.valid = false;
            		$('#qyjc_tips').html("企业全称最多填15位");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#qyjc_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#lxrxm')) {
        		if($.trim($("#lxrxm").val()).length>60)
            	{
            		validity.valid = false;
            		$('#lxrxm_tips').html("姓名最多填60位");
            	}
            	else if($.trim($("#lxrxm").val())=="")
            	{
            		validity.valid = false;
            		$('#lxrxm_tips').html("*必填");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxrxm_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#lxrzj')) {
        		if($.trim($("#lxrzj").val()).length>15)
            	{
            		validity.valid = false;
            		$('#lxrzj_tips').html("座机最多填15位");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxrzj_tips').html("");
			    }
        	}
        	
        	 /*if ($(validity.field).is('#kfqq')) {
        		if($.trim($("#kfqq").val()).length>20)
            	{
            		validity.valid = false;
            		$('#kfqq_tips').html("QQ号最多填20位");
            	}
    			else if($.trim($("#kfqq").val())=="")
            	{
            		validity.valid = false;
            		$('#kfqq_tips').html("*必填");
            	}
            	else if(isNaN($.trim($("#kfqq").val())))
            	{
            		validity.valid = false;
            		$('#kfqq_tips').html("QQ号只能是数字");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#kfqq_tips').html("");
			    }
        	} */
        	
        	if ($(validity.field).is('#lxrsj')) {
        		if($.trim($("#lxrsj").val())==""||$.trim($("#lxrsj").val()).length!=11)
            	{
            		validity.valid = false;
            		$('#lxrsj_tips').html("手机号只能11位");
            	}
            	else if(isNaN($.trim($("#lxrsj").val())))
            	{
            		validity.valid = false;
            		$('#lxrsj_tips').html("手机号只能是数字");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxrsj_tips').html("");
			    }
        	}
        	if ($(validity.field).is('#lxremail')) {
            	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
            	if (!filter.test($.trim($("#lxremail").val()))||$.trim($("#lxremail").val())=="")
            	{
            		validity.valid = false;
            		$('#lxremail_tips').html("请输入正确的邮箱格式");
            	}
            	else
			    {
			    	validity.valid = true;
                    $('#lxremail_tips').html("");
			    }
            }           
        },
        
        submit: function() {
        	if(this.isFormValid()){
        	
        	
        	$.ajax( {  
	        type : 'POST',  
	        url : '/login/register/rgtwo',  
	        data : $('#my-form').serialize(),  
	        success : function(data) {  
	        	var msg = data.message;
	        	if(msg==1)
        		{
	        		alert('保存成功');
	        		var userid = $("#yhid").val();
	        		window.location.href="/login/registerthree?userid="+userid;
        		}
	        	if(msg==-1)
	        	{
	        		alert('企业名称已经存在!');
	        	}
	        	if(msg==-2)
	        	{
	        		alert('身份证号已经存在!');
	        	}
	        	if(msg==-3)
	        	{
	        		alert('该用户此步骤已经注册过，请进行其他操作!');
	        	}
	        },  
	        error : function(data) {  
	          alert("保存失败")  
	        }  
	      });
        }
        }
    })
	</script>
   
</body>
</html>